#include <iostream>
#include <ctime>
#include <cstdlib>

using namespace std;

//定义函数
int * getRandom() {
    static int r[10]; //定义数组
    srand((unsigned)time(NULL)); //设置随机种子

    for(int i = 0; i < 10; i++){
        r[i] = rand();
        cout << r[i] << endl;
    }
    return r;
}

int main() {
    int *p;
    p = getRandom();

    for (int i = 0; i < 10; i++)
    {
        cout << "*(p + " << i << "):";
        cout << *(p + i) << endl;
        cout << (p + i) << endl;
    }
    
}
